import { createApp } from 'vue'
import App from './App.vue'
//引入element-plus插件与样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
//引入图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//引入组件样式
import 'vant/lib/index.css'
import router from './router'
import vant from "vant";
import './assets/common.scss'
const app=createApp(App);
//pinia仓库
import pinia from './store'

app.use(router);
// 使用vant
app.use(vant);
//使用element-plus
app.use(ElementPlus, {
    locale: zhCn,
});
//element-plus 图标全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
//安装仓库
app.use(pinia);
const rootValue = 16
const rootWidth = 390
const deviceWidth = document.documentElement.clientWidth
document.documentElement.style.fontSize = (deviceWidth * rootValue) / rootWidth + 'px'


app.mount('#app')
